<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'qvfields-form',
	'enableAjaxValidation'=>true,
)); ?>

	
	<?php echo $form->errorSummary($model); ?>

        <?php echo $form->hiddenField($model,'qvf_docName'); ?>
	<?php echo $form->error($model,'qvf_docName'); ?>

    <fieldset>
        <legend>new <?php echo $form->labelEx($model,'qvf_fieldName'); ?></legend>
        <table>

	<tr class="row">
            <td>
                <?php echo $form->textField($model,'qvf_fieldName',array('size'=>19,'maxlength'=>150)); ?>
		<?php echo $form->error($model,'qvf_fieldName'); ?>
            </td>
            <td>
	<?php echo CHtml::ajaxButton('add',
                CHtml::normalizeUrl(array('//qvfields/ajaxupdate')),
                    array(
                        'type'=>'POST',
                        'success'=>'function(responseTextQVfield,statusText) {
                                        alert("added, pls reload");
                                    }',
                    ),
            array('class'=>'ui-button ui-widget ui-state-default ui-corner-all','id'=>'field_save_button'));
        ?>
            </td>
        </tr>

        </table>
    </fieldset>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php
$this->widget('ext.ajaxform.JAjaxForm',array(
    'formId'=>'qvfields-form',
    'options'=>array(
        'dataType'=>'json',
    ),
));
?>